﻿using System;
using System.Collections.Generic;
using Enferno.Public.Web.ViewModels;

namespace Enferno.Public.Web.Components.Server.ViewModels
{
    public abstract class CheckoutViewModelBase : BaseViewModel
    {
        protected CheckoutViewModelBase()
        {
            TypeName = GetType().Name;
        }

        public string TypeName { get; private set; }
        public BasketViewModel Basket { get; set; }
        public CheckoutBuyerViewModel Buyer { get; set; }

        public ICheckoutPayerViewModel Payer { get; set; }
        public ICheckoutShipToViewModel ShipTo { get; set; }
        public IEnumerable<DeliveryMethodViewModel> DeliveryMethods { get; set; }
        public IEnumerable<PaymentMethodViewModel> PaymentMethods { get; set; } 
        public string OrderReference { get; set; }
    }

    public class CheckoutViewModel<TPayerViewModel, TShipToViewModel>: CheckoutViewModelBase
        where TPayerViewModel : ICheckoutPayerViewModel
        where TShipToViewModel : ICheckoutShipToViewModel
    {
        public new TPayerViewModel Payer { get; set; }
        public new TShipToViewModel ShipTo { get; set; }
    }

    public class CompanyCheckoutViewModel :
        CheckoutViewModel<CheckoutCompanyPayerViewModel, CheckoutCompanyShipToViewModel>
    {
    }

    public class PrivateCheckoutViewModel :
        CheckoutViewModel<CheckoutPrivatePayerViewModel, CheckoutPrivateShipToViewModel>
    {
    }


}
